<!DOCTYPE html>
<html>
<body>
<meta charset="UTF-8">
<p>canvas图像显示</p>
<img id="tulip" src="./1.png" alt="The Tulip" />

<p>画布：</p>
<canvas id="myCanvas" width="1920" height="1080" style="border:1px solid #d3d3d3;background:#ffffff;">
Your browser does not support the HTML5 canvas tag.
</canvas>

<script>

// var c=document.getElementById("myCanvas");
// var ctx=c.getContext("2d");
// var img=document.getElementById("tulip");
// ctx.drawImage(img,10,10);

window.onload=function(){
    var canvas = document.getElementById("myCanvas");
    var image=document.getElementById("tulip");
    var context = canvas.getContext("2d");
    context.drawImage(image,10,10);
}

</script>

</body>
</html>